import os.path
import time
import datetime

num = int(input("请输入要创建的文件的数量:"))
for i in range(num):
    t=datetime.datetime.now()
    print(t)
    path=r'C:\Users\HUAWEI\Desktop'
    t=t.strftime("%Y%m%d%H%M%S")
    filename=os.path.join(path,t+".txt")
    f=open(filename,"w",encoding="UTF-8")
    time.sleep(1)
    f.close()
    print("file " + str(i+1) + ":" + str(filename))
    print("创建成功")